Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class Microsoft.​AspNetCore.​Authentication.​AuthenticationHandler<​TOptions>

Assembly: Microsoft.AspNetCore.Authentication

Inheritance: object → AuthenticationHandler

Implemented Interfaces

An opinionated abstraction for implementing <see cref="T:Microsoft.AspNetCore.Authentication.IAuthenticationHandler" /> .

Properties

Scheme
Gets or sets the <see cref="T:Microsoft.AspNetCore.Authentication.AuthenticationScheme" /> associated with this authentication handler.
public TOptions
Options
Gets or sets the options associated with this authentication handler.
Context
Gets or sets the <see cref="T:Microsoft.AspNetCore.Http.HttpContext" /> .
Request
Gets the <see cref="T:Microsoft.AspNetCore.Http.HttpRequest" /> associated with the current request.
Response
Gets the <see cref="T:Microsoft.AspNetCore.Http.HttpResponse" /> associated with the current request.
protected Http.​PathString
OriginalPath
Gets the path as seen by the authentication middleware.
protected Http.​PathString
OriginalPathBase
Gets the path base as seen by the authentication middleware.
Gets the <see cref="T:Microsoft.Extensions.Logging.ILogger" /> .
Gets the <see cref="P:Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.UrlEncoder" /> .
protected ISystemClock
Clock
Gets the <see cref="T:Microsoft.AspNetCore.Authentication.ISystemClock" /> .
TimeProvider
Gets the current time, primarily for unit testing.
OptionsMonitor
Gets the <see cref="T:Microsoft.Extensions.Options.IOptionsMonitor`1" /> to detect changes to options.
protected object
Events
The handler calls methods on the events which give the application control at certain points where processing is occurring. If it is not provided a default instance is supplied which does nothing when the methods are called.
protected string
ClaimsIssuer
Gets the issuer that should be used when any claims are issued.
protected string
CurrentUri
Gets the absolute current url.

Methods

InitializeAsync​(AuthenticationScheme scheme, Http.​HttpContext context)
Initialize the handler, resolve the options and validate them.
InitializeEventsAsync​()
Initializes the events object, called once per request by <see cref="M:Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.InitializeAsync(Microsoft.AspNetCore.Authentication.AuthenticationScheme,Microsoft.AspNetCore.Http.HttpContext)" /> .
CreateEventsAsync​()
Creates a new instance of the events instance.
Returns A new instance of the events instance.
InitializeHandlerAsync​()
Called after options/events have been initialized for the handler to finish initializing itself.
Returns A task
protected string
BuildRedirectUri​(string targetPath)
Constructs an absolute url for the specified <paramref name="targetPath" /> .
Returns The absolute url.
targetPath The path.
protected string
ResolveTarget​(string scheme)
Resolves the scheme that this authentication operation is forwarded to.
Returns The forwarded scheme or <see langword="null" /> .
scheme The scheme to forward. One of ForwardAuthenticate, ForwardChallenge, ForwardForbid, ForwardSignIn, or ForwardSignOut.
AuthenticateAsync​()
HandleAuthenticateOnceAsync​()
Used to ensure HandleAuthenticateAsync is only invoked once. The subsequent calls will return the same authenticate result.
HandleAuthenticateOnceSafeAsync​()
Used to ensure HandleAuthenticateAsync is only invoked once safely. The subsequent calls will return the same authentication result. Any exceptions will be converted into a failed authentication result containing the exception.
HandleAuthenticateAsync​()
Allows derived types to handle authentication.
Returns The <see cref="T:Microsoft.AspNetCore.Authentication.AuthenticateResult" /> .
HandleForbiddenAsync​(AuthenticationProperties properties)
Override this method to handle Forbid.
Returns A Task.
HandleChallengeAsync​(AuthenticationProperties properties)
Override this method to deal with 401 challenge concerns if an authentication scheme in question deals an authentication interaction as part of its request flow (like adding a response header, or changing the 401 result to 302 of a login page or external sign-in location).
Returns A Task.
ChallengeAsync​(AuthenticationProperties? properties)
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object